import express from 'express';
const createError = require('http-errors');
const router = express.Router();
import auth from "./anth";
router.get('/', (req, res) => {
  res.send('Hello World!');
});
router.use('/auth', auth);
router.use( async (req, res, next) => {
  next(createError.NotFound('Route not Found'))
})
router.use(async (req, res, next, ) => {
  console.log('resres==', res.statusCode);
  console.log('resres==', res.statusMessage);
  res.status(res.statusCode || 500).json({
    status: false,
    message: res.statusMessage
  })
    // res.send('请求错误！');
})
export default router;
